package com.oncecloud.devops.client.dao;

import java.sql.SQLException;
import java.util.List;

import com.oncecloud.devops.client.entity.UserRoleEnv;
/**
 * 用户角色信息接口
 * @author xzg
 *
 */
public interface UserRoleMapper {

	/**
	 * 根据用户角色查询
	 * @param userRole
	 * @return
	 */
	public List<UserRoleEnv> selectByUserRole(UserRoleEnv userRole) throws SQLException;
	
	/**
	 * @param id
	 * @return
	 * @throws SqlException
	 */
	public UserRoleEnv selectByPrimaryKey(Integer id) throws SQLException;
	
	/**
	 * @param userId
	 * @return
	 * @throws SqlException
	 */
	public int deleteByUserId(Integer userId) throws SQLException;
	
	/**
	 * @param id
	 * @return
	 * @throws SqlException
	 */
	public int deleteByPrimaryKey(Integer id) throws SQLException;
	
	/**
	 * @param record
	 * @return
	 * @throws SqlException
	 */
	public int insert(UserRoleEnv record) throws SQLException;
	
	/**
	 * @param record
	 * @return
	 * @throws SqlException
	 */
	public int insertSelective(UserRoleEnv record) throws SQLException;
	
	/**
	 * 为用户批量增加角色和环境
	 * @param ure
	 * @return
	 * @throws SQLException
	 */
	public int insertListURE(List<UserRoleEnv> ure) throws SQLException;
	/**
	 * @param record
	 * @return
	 * @throws SqlException
	 */
	public int updateByPrimaryKeySelective(UserRoleEnv record) throws SQLException;

	/**
	 * @param record
	 * @return
	 * @throws SqlException
	 */
	public int updateByPrimaryKey(UserRoleEnv record) throws SQLException;
	
}
